const Parent = () => {
  const data = {
    name: 'xiao ming',
    age: 18
  };
  const version = '3.0';
  const emitFun = e => {
    console.log('emitFun', e);
  };
  return (
    <section>
      <Child data={data} version={version} submit={emitFun} />
    </section>
  );
};

// 子组件
function Child(props) {
  console.log('props', props);
  // 子传父
  const handleSubmit = () => {
    props.submit('123');
  };
  return (
    <div>
      <div>
        {props.data.name}
        <br />
        {props.data.age}
      </div>
      <div>{props.version}</div>
      <button onClick={handleSubmit}>submit</button>
    </div>
  );
}
export default Parent;
